<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>下载</title>
<jsp:include page="../../import.jsp" flush="true" />
<jsp:include page="../assParking/assParkCommon.jsp" flush="true" /><!-- 时间格式转换 -->
</head>
<body class="iframeBody">
	<form id="carCostInfo_form">
	<div id="ligergrid1" class="sq-grid"></div>
	</form>
</body>
<script type="text/javascript">
	var fileGrid = null;
	
	$(function () {
		var _pkId = '${pkId}';
		var _tabNm = '${tabNm}';
		var _flag = '${flag}'; 
		var _url ='<%=path%>/ass/assTrailCarM/initFilesList.do';
	    $("#ligergrid1").ligerGrid({
	    	usePager: false,
	    	url: _url,
	    	method : 'get',
	    	parms:{
	    		pkId:_pkId,
	    		tabNm:_tabNm,
	    		falg:_flag
	    	},
	        columns: [
	            { display: '文件名', minWidth: 100,
	            	render: function (rowdata, rowindex, value){
	            		var h;
				            h='<a href="javascript:uploadFileByUrl(';
			                h+="'"+rowdata.filePath+"'";
			                h+=",'"+rowdata.fileNm+"'";
			                h+=')">'+rowdata.fileNm+'</a>'
			            return h;
			        }	
	            },
	            /* { display: '验证状态', minWidth: 100,name:'audStsCdNm'}, */
	            /*{ 
	            	display: '下载', 
	            	name: 'filePath', 
	            	minWidth: 100,
	            	render: function (rowdata, rowindex, value){
	                    var h='<a target="_blank" href="'+'<%=path%>/system/sysulfilesrec/downLoad.do?fileName='+ rowdata.fileNm+'&filePath='+ rowdata.filePath +'">'+ '下载附件' +'</a>';
	                    return h;
	                }	
	            },*/
	            //getUlFileRecDelColumn()
	        ],
	        pageSize:10,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        width: '100%',
	        rownumbers:true,
	        onAfterShowData: function () {
	            $( ".gridTip").grid_ligerTip();
	            SetIframe_height ();
	       }
	    });
	    fileGrid = liger.get("ligergrid1");
	    //grid.setHeight(100);
	});
	
	function uploadFileByUrl(_url,_name){
		if(SQ.regs.img.test(_name)){
			//SQ.imgPreview(_url);
         window.__ImgSrc = _url;
         window.__ImgTit = _name;
         window.open('<%=path%>/project/prjbscinfo/imgWinOpen.do', '', 'location=yes, width=800, height=600');
		}else{
	        window.open(_url);
		}
    }
	
	
	
	
	function iframeResize () {
	    if (parent.mainApp) {
	        parent.mainApp.parentTab.onResize();
	    };
	}
	//刷新附件列表
	function refreshUlFileRecList(){
		fileGrid.reload();
	}
	//刷新附件列表:重新设置
	function refreshUlFileRecListByPkId(_pkId,_tabNm){
		fileGrid.setParm("pkId",_pkId);
		fileGrid.setParm("tabNm",_tabNm);
		fileGrid.reload();
	}
	
</script>


